﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcFinalTest.Models.JobTypeModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	List of Job Type
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>List of Job Type</h2>
    <% if (ViewData["JobTypeData"].Equals("0"))
       { %>
            <p><i>(Contains No Data)</i></p>
    <% }
       else
       { %>
    <table>
        <tr>
            <th></th>
            <th>
                Job Type ID
            </th>
            <th>
                Name
            </th>
            <th>
                Rate Per Hour
            </th>
        </tr>

    <% foreach (var item in Model)
       { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id = item.JobTypeId })%> |
                <%: Html.ActionLink("Details", "Details", new { id = item.JobTypeId })%> |
                <%: Html.ActionLink("Delete", "Delete", new { id = item.JobTypeId }, new { onclick = "return confirm('Are you sure you want to delete?')" })%>
            </td>
            <td>
                <%: item.JobTypeId%>
            </td>
            <td>
                <%: item.Name%>
            </td>
            <td>
                <%: String.Format("{0:F}", item.RatePerHour)%>
            </td>
        </tr>
    
    <% }
       } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

